.org 0xE6778 ; Capture Increase

Capture_Increase:

	PUSH 	{R4-R6, LR}
	
	LDR 	R3, [Capture_Increase_1]
	LDR 	R2, [Capture_Increase_2]	
	LDR 	R4, [R3, 0]
	LDR 	R3, [R2, 0]	
	MOV 	R2, 0x98		
	ADD 	R3, R4, R3, LSL 2
	MUL		R5, R0, R2
	LDR		R3, [R3, 0x48]
	MOV		R4, R1, LSL 4
	ADD 	R0, R3, 0x5000
	LDR 	R0, [R0, 0xA58]
	MOV		R6, 0
	ADD 	R0, R0, R5
	ADD 	R0, R0, 0x74
	ADD		R0, R0, R1, LSL 4
	
	MOV 	R1, Rank_Invader					; Rank: Rank Invader
	
	BL 		Check_Skills_Equipped				; Check the Skill is equipped
	
	CMP 	R0, 0								; Does CO use that skill?
	
	LDR 	R1, [Capture_Increase_1]
	LDR 	R0, [Capture_Increase_2]	
	LDR 	R2, [R1, 0]
	LDR 	R0, [R0, 0]
	
	MOV 	R1, Rank_Conqueror					; Rank: Conqueror
	
	ADD 	R0, R2, R0, LSL 2
	LDR		R0, [R0, 0x48]
		
	ADDNE 	R6, R6, 1							; If CO use skill, add +1 to capture
	
	ADD 	R0, R0, 0x5000
	LDR 	R0, [R0, 0xA58]
	ADD 	R0, R0, R5
	ADD 	R0, R0, 0x74
	ADD		R0, R0, R4
	
	BL 		Check_Skills_Equipped				; Check the Skill is equipped
	
	CMP 	R0, 0								; Does CO use that skill?
	ADDNE 	R6, R6, 2							; If CO use skill, add +2 to capture
	
	MOV 	R0, R6
	
	POP 	{R4-R6, LR}
	
	BX 		LR

;-------------------------------------------------------------------------------		

Capture_Increase_1:
	.dw Reg1_Skill
	
Capture_Increase_2:
	.dw Reg2_Skill



